home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus Special 25 / AMIGAplus Sonderheft 25 (2000)(Falke)(DE)(Track 1 of 4)[!].iso / PublicDomain / Anwendungen / DMAmon / DMAmon.bas < prev    next >
BASIC Source File  |  1999-03-03  |  2KB  |  86 lines

  1. ' DMA Monitor - SNG March 1999, HiSoft BASIC, WB2+
  2.  
  3. DEFDBL a-z
  4.  
  5. REM $INCLUDE diskfont.bh
  6. REM $INCLUDE dos.bh
  7. REM $INCLUDE graphics.bh
  8. LIBRARY OPEN "diskfont.library"
  9. LIBRARY OPEN "dos.library"
  10. LIBRARY OPEN "graphics.library"
  11.  
  12. WINDOW 1,"  Hisoft BASIC Amiga DMA Monitor", _
  13.     (200,16)-(300,80),1+2+4+16+256
  14.  
  15. ' Hardware addresses
  16.  
  17. CUSTOM& =&HDFF000
  18. DMACONR&=CUSTOM&+2
  19. DSKBYTR&=CUSTOM&+&H1A
  20.  
  21. REM Use another Compugraphic font if you like
  22.  
  23. DIM TextAttr%(4)
  24. InitTextAttr TextAttr%(),"Courier.font",15,0,0
  25. font& = OpenDiskFont(VARPTR(TextAttr%(0)))
  26. SetFont WINDOW (8),font&
  27.  
  28. REPEAT poll
  29.   LOCATE 2,1
  30.   
  31.   DMA%=PEEKW(DMACONR&)
  32.  
  33. ' REM Status of the next two does not seem to change 
  34. '
  35. '  PRINT "  Bit Blitter activity ";
  36. '  IF (DMA% AND &B0100000000000000)=0
  37. '    PRINT   "Idle  "
  38. '  ELSE
  39. '    IF (DMA% AND &B0000010000000000)
  40. '      PRINT "Active"
  41. '    ELSE
  42. '      PRINT "Nasty!"
  43. '    END IF
  44. '  END IF
  45. '  
  46. '  PRINT "   Sprite DMA enabled?  ";
  47. '  IF (DMA% AND &B0000000000100000)
  48. '    PRINT "Active"
  49. '  ELSE
  50. '    PRINT "Blank "
  51. '  END IF
  52. '
  53.   
  54.   PRINT "  Sound channel status ";
  55.   PRINT RIGHT$("000"+BIN$(DMA% AND &B1111),4)
  56.  
  57.   PRINT "  Floppy Disk activity ";
  58.   DiskFlags%=PEEKW(DSKBYTR&)
  59.   IF (DiskFlags% AND &B0100000000000000)=0
  60.     PRINT   "Idle   "
  61.   ELSE
  62.     IF (DiskFlags% AND &B0010000000000000)
  63.       PRINT "Writing"
  64.     ELSE
  65.       PRINT "Reading"
  66.     END IF
  67.   END IF
  68.  
  69. ' IF MOUSE(0) THEN EXIT poll
  70.   
  71.   Delay &20 ' Update 2 or 3 times per second
  72.   
  73. END REPEAT poll
  74.  
  75. STOP
  76.  
  77. ' Compugraphc font initialisation, from a HiSoft BASIC example file
  78.  
  79. SUB InitTextAttr(T%(1),FontName$,BYVAL Height%,BYVAL style%,BYVAL flags%)
  80.  
  81. POKEL VARPTR(T%(0))+ta_Name%,SADD(FontName$+CHR$(0))
  82. T%(ta_YSize%\2)=Height%
  83. POKEB VARPTR(T%(0))+ta_Style%,style% : POKEB VARPTR(T%(0))+ta_Flags%,flags%
  84.  
  85. END SUB ' InitTextAttr
  86.